LocalCostHandler = LocalServerBaseHandler.New()

local t = LocalCostHandler

local testData = {}
function t:Register()
    self:RegisterReq(136201) --请求集市信息
end

function t:Receive(msg)
    if msg.msgId == 136201 then --更新
        local m = ResSendMarketInfoMessage.New();
        m.openServerTime = HelperFunc.GetServerTime() * 1000;
        m.combineServerTIme = HelperFunc.GetServerTime() * 1000;
        m.rechargeSum = 0;
        m.costGoldSum = 0;
        m.firstRechargeTime = HelperFunc.GetServerTime() * 1000 - 4000000;
        local table1 = {};
        local data = {}
        data.marketID = 10001;
        data.conditionParams = {};
        data.marketParams = {};
        for i = 1, 1 do
            local xx = {};
            xx.id = 100010 + i;
            xx.remainDay = 25;
            table.insert(data.marketParams, getJsonStr(xx));
        end
        table.insert(table1,data);
        local data = {}
        data.marketID = 10002;
        data.conditionParams = {};
        data.marketParams = {};
        for i = 1, 5 do
            local xx = {};
            xx.id = 100020 + i;
            xx.buyNum = 0;
            xx.startTime = HelperFunc.GetServerTime() * 1000;
            table.insert(data.marketParams, getJsonStr(xx));
        end
        table.insert(table1,data);
        local data = {}
        data.marketID = 20001;
        data.conditionParams = {};
        data.marketParams = {};
        for i = 1, 5 do
            local xx = {};
            xx.id = 1000 + i;
            xx.buyNum = 0;
            xx.startTime = HelperFunc.GetServerTime() * 1000;
            table.insert(data.marketParams, getJsonStr(xx));
        end
        table.insert(table1,data);
        --for i = 10003, 10005 do
        --    local data = {}
        --    data.marketID = i;
        --    data.startTime = (os.time() - 86400 +  600 * (i - 10002)) * 1000;
        --    data.endTime = (os.time() + 600 * (i - 10002)) * 1000;
        --    data.marketParams = {};
        --    for j = 1, 9 do
        --        local xx = {};
        --        xx.id = i * 10 + j;
        --        xx.residue = 1;
        --        xx.money = 6 * j;
        --        table.insert(data.marketParams, getJsonStr(xx));
        --    end
        --    table.insert(table1,data);
        --end
        m.tempMarketDataList = table1;
        LocalServer.Send(m);
    end
end
